<template>
	<view class="">
		<u-navbar title="合同详情" @leftClick="leftClick" :autoback="true"></u-navbar>
		<contractDetails :isshow="'true'" :isPdf="isPdf" :info="info"></contractDetails>
	</view>
</template>

<script>
	import contractDetails from '../../components/contractDetails.vue'
	export default {
		components:{contractDetails},
		data() {
			return {
				info:{},
				isPdf:false
			};
		},
		onLoad(option) {
			this.info = JSON.parse(option.info);
			
			if(!this.info.contractFile) this.isPdf = false;
			else {
				let splitKey = this.info.contractFile.split('.');
				this.isPdf = (splitKey[splitKey.length -1]) == 'pdf' ? true : false;
			}
		},
		methods:{
			leftClick(){
				if (getCurrentPages().length > 1) {
					uni.navigateBack();
				} else {
					uni.switchTab({
						url: '../../pages/index/index'
					})
				}
			},
			
			submit(){
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	
</style>